import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("withdrawal_record", { schema: "charge" })
export class WithdrawalRecord {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", {
    name: "merchant_id",
    comment: "商户",
    unsigned: true,
    default: () => "'0'",
  })
  merchantId: number;

  @Column("int", {
    name: "member_id",
    comment: "提现的人",
    unsigned: true,
    default: () => "'0'",
  })
  memberId: number;

  @Column("decimal", {
    name: "amount",
    comment: "提现的钱",
    precision: 12,
    scale: 2,
    default: () => "'0.00'",
  })
  amount: string;

  @Column("varchar", { name: "payee", comment: "收款人", length: 10 })
  payee: string;

  @Column("varchar", { name: "account", comment: "收款账号", length: 20 })
  account: string;

  @Column("varchar", { name: "bank", comment: "银行", length: 20 })
  bank: string;

  @Column("tinyint", {
    name: "status",
    comment: "0：等待提现,1:已打款,2:拒绝，3：商户撤销",
    default: () => "'0'",
  })
  status: number;

  @Column("varchar", { name: "reason", comment: "原因", length: 100 })
  reason: string;

  @Column("int", {
    name: "create_time",
    comment: "发起时间",
    unsigned: true,
    default: () => "'0'",
  })
  createTime: number;

  @Column("int", {
    name: "complete_time",
    comment: "发起时间",
    unsigned: true,
    default: () => "'0'",
  })
  completeTime: number;
}
